package com.fb.controller;

import com.fb.model.Bing;
import com.fb.service.IBingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;

@Controller
@RequestMapping("/api/bing")
public class BingController {
    @Autowired
    private IBingService bingService;

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    @ResponseBody
    public Bing add(Bing bing) {
        return bingService.add(bing);
    }

    @RequestMapping(value = "/update", method = RequestMethod.GET)
    @ResponseBody
    public Bing update(Bing bing) {
        return bingService.update(bing);
    }

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    public List<Bing> list(Bing bing) {
        return bingService.list(bing);
    }

}
